<?php

require_once '../conf.php';
require_once PATH_TO_SOURCE.'/model/model.php';
require_once PATH_TO_SOURCE.'/controller/controller.php';


$x = new categoryMain();

$n = count($x->getCategoryList());
$list = $x->getCategoryList();
$mass_text = '';

for ($i=0;$i<$n;$i++){
	$name = $list[$i]['name'];
	$id = $list[$i]['id'];
	$url = $list[$i]['url'];
	

$mass_text =$mass_text.  "
<figure class=\"grid col-one-third mq1-col-one-half mq2-col-one-third mq3-col-full work_1\">
						<img src=\"/view/img/categories/".$id.".jpg\" alt=\"\" >		
					<figcaption>
						<a href=\"/".$url."\" class=\"arrow\">".$name."</a>
						
					</figcaption>
				</figure>
";
}

?>
<div class="works-page main grid-wrap">
<header class="grid col-full">
			<hr>
			<p class="fleft">Tabele kalorii, kalorie</p>
		</header>

<div>
		<section class="grid col-three-quarters mq2-col-full">
		
					<div class="grid-wrap works">
		
			
	<?php
		echo $mass_text; 
	?>
		
			</div> <!-- grid inside 3/4-->
	

		</section>	
</div>
</div>